import { MyRequestOptions,HttpResponse } from './type';
import request from '@/utils/api/request';

export const listCategory = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/listCategory`;
  return request.get(option);
};
export const insertOrUpdateCategory = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/insertOrUpdateCategory`;
  return request.post(option);
};

export const deleteCategory = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/deleteCategory`;
  return request.post(option);
};

export const pageProduct = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/pageProduct`;
  return request.get(option);
};

export const listUserSpecAttr = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/listUserSpecAttr`;
  return request.get(option);
};


export const saveOrUpdateSpecAttr = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/saveOrUpdateSpecAttr`;
  return request.post(option);
};

export const saveOrUpdateSpecAttrValue = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/saveOrUpdateSpecAttrValue`;
  return request.post(option);
};

export const deleteUserAttrSpec = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/deleteUserAttrSpec`;
  return request.post(option);
};

export const deleteUserAttrSpecValue = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/deleteUserAttrSpecValue`;
  return request.post(option);
};

export const addOrUpdateProduct = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/addOrUpdateProduct`;
  return request.post(option);
};

export const upOrDownGoods = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/upOrDownGoods`;
  return request.post(option);
};
export const productDetail = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/productDetail`;
  return request.get(option);
};

export const pageLifeProducts = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/life/pageLifeProducts`;
  return request.get(option);
};

export const lifeProductDetail = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/life/lifeProductDetail`;
  return request.get(option);
};

export const otherStoreInfo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/otherStoreInfo`;
  return request.get(option);
};

export const listCategoryByStoreId = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/listCategoryByStoreId`;
  return request.get(option);
};

export const insertShoppingCar = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/shopping/insertShoppingCar`;
  return request.post(option);
};

export const pageShopping = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/shopping/pageShopping`;
  return request.get(option);
};
export const submitOrderAndPay = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/submitOrderAndPay`;
  return request.post(option);
};
export const buyerOrderPage = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/buyerOrderPage`;
  return request.get(option);
};

export const queryEmsByGroupOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/queryEmsByGroupOrder`;
  return request.get(option);
};

export const receiveOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/receiveOrder`;
  return request.post(option);
};
export const commentsOrderProduct = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/commentsOrderProduct`;
  return request.post(option);
};

export const orderProductListBySonOrderNo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/orderProductListBySonOrderNo`;
  return request.get(option);
};

export const orderDetailByGroupOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/orderDetailByGroupOrder`;
  return request.get(option);
};

export const orderToShoppingCar = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/orderToShoppingCar`;
  return request.post(option);
};

export const cancelOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/cancelOrder`;
  return request.post(option);
};

export const payOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/payOrder`;
  return request.post(option);
};
export const refundReasonList = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/refundReasonList`;
  return request.get(option);
};

export const applyRefund = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/applyRefund`;
  return request.post(option);
};

export const getRefundDetail = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/getRefundDetail`;
  return request.get(option);
};
export const cancelRefund = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/cancelRefund`;
  return request.post(option);
};

export const buyerSend = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/buyerSend`;
  return request.post(option);
};

export const queryRefundBuyerLogistics = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/queryRefundBuyerLogistics`;
  return request.get(option);
};

export const sellerOrderPage = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/sellerOrderPage`;
  return request.get(option);
};

export const orderDetailBySonOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/orderDetailBySonOrder`;
  return request.get(option);
};

export const queryEmsBySonOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/queryEmsBySonOrder`;
  return request.get(option);
};

export const sendOrder = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/sendOrder`;
  return request.post(option);
};

export const storeReplyComments = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/storeReplyComments`;
  return request.post(option);
};

export const pageSellerRefundList = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/pageSellerRefundList`;
  return request.get(option);
};
export const pageBuyerRefundList = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/pageBuyerRefundList`;
  return request.get(option);
};
export const auditRefund = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/auditRefund`;
  return request.post(option);
};
export const sellerReceive = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/sellerReceive`;
  return request.post(option);
};
export const sellerRepeatSend = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/sellerRepeatSend`;
  return request.post(option);
};

export const buyerReceiveRefund = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/buyerReceiveRefund`;
  return request.post(option);
};
export const deleteShopping = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/shopping/deleteShopping`;
  return request.post(option);
};
export const countShopping = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/shopping/countShopping`;
  return request.get(option);
};
export const paySpuHot = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/paySpuHot`;
  return request.post(option);
};
export const pageSpuHotHistory = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/pageSpuHotHistory`;
  return request.get(option);
};
export const productDeleteSpu = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/product/deleteSpu`;
  return request.post(option);
};

export const ocrEmsFile = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/ocrEmsFile`;
  return request.get(option);
};

export const queryJoinDetailByFreeCode = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/activity/queryJoinDetailByFreeCode`;
  return request.get(option);
};
